
    
    axios({
        method: 'get',
        url: './json/home_goods_list.json'
    }).then(res => {
        if (res.data.code === 20000) {
            var goods_list = res.data.data
            var goods_box = document.querySelector('.home_goods_list').children[0] 
            goods_list.forEach(e => {
                var item = document.createElement('li');
                
                var img_box = document.createElement('div')
                var img_link = document.createElement('a')
                var img = document.createElement('img')
                var goods_name = document.createElement('p')
                var goods_price = document.createElement('p')
                img_link.append(img)
                img_box.append(img_link)
                img_box.className = "img_box"
                img.src = e.goods_url
                img_link.href = "#"
                goods_name.innerText = e.goods_name
                goods_price.innerText = "￥" + e.goods_price
                goods_price.className = "mm"

                item.append(img_box)
                item.append(goods_name)
                item.append(goods_price)

                if (e.icon_url) {
                    var icon_span = document.createElement('span')
                    var icon = document.createElement('img')
                    icon_span.className = "span_01"
                    icon.src = e.icon_url
                    icon_span.append(icon)
                    item.append(icon_span)
                }

                
                goods_box.append(item)

                console.log(goods_box)
                // console.log(item)
            });
        }
    })
    

